<?php 
require_once '../include.php';

header('content-type:text/html;charset=utf-8');

@$page=$_REQUEST['page']?(int)$_REQUEST['page']:1;
$pageSize=10;
$rows=getPriceByPage($page,$pageSize);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="styles/backstage.css">
</head>
<body>
<div class="details">
                    
                    <!--表格-->
                    <table class="table" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr>
                                <th width="3%">编号</th>
                                <th width="5%">项目负责人</th>
                                <th width="10%">留言内容</th>
                                <th width="5%">联系电话</th>
                                <th width="6%">项目名称</th>
                                <th width="8%">项目详细地址</th>
                                <th width="5%">项目地处</th>
                                <th width="6%">总占地面积</th>
                                <th width="8%">景观设计面积</th>
                                <th width="5%">类别比率</th>
                                <th width="5%">土地证明</th>
                                <th width="8%">规划设计阶段</th>
                                <th width="8%">楼盘拟建档次</th>
                                <th width="5%">投资预算</th>
                                <th width="6%">提交时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php  foreach($rows as $row):?>
                            <tr>
                                <!--这里的id和for里面的c1 需要循环出来-->
                                <td><label for="c1" class="label"><?php echo $row['id'];?></label></td>
                                <td><?php echo $row['resName'];?></td>
                                <td><?php echo $row['content'];?></td>
                                <td><?php echo $row['tel'];?></td>
                                <td><?php echo $row['pName'];?></td>
                                <td><?php echo $row['pAddress'];?></td>
                                <td>
                                    <?php 
                                        $pcate = '';
                                        switch ($row['pCate']) {
                                             case 'A':
                                                 $pcate = "市区";
                                                 break;
                                             case 'B':
                                                 $pcate = "近郊区";
                                                 break;
                                             case 'C':
                                                 $pcate = "郊区";
                                                 break;
                                             case 'D':
                                                 $pcate = "新兴产业开发区";
                                                 break;
                                             case 'E':
                                                 $pcate = "其他";
                                                 break;
                                             
                                             default:
                                                 $pcate = "其他";
                                                 break;
                                         } 
                                         echo $pcate;
                                    ?>
                                </td>
                                <td><?php echo $row['tArea'];?></td>
                                <td><?php echo $row['pArea'];?></td>
                                <td><?php echo $row['rate'];?></td>
                                <td>
                                    <?php 
                                        $lCerti = '';
                                        switch ($row['lCerti']) {
                                             case 'A':
                                                 $lCerti = "已经批核";
                                                 break;
                                             case 'B':
                                                 $lCerti = "仍在审核中";
                                                 break;
                                             case 'C':
                                                 $lCerti = "未获批核";
                                                 break;
                                            
                                             default:
                                                 $lCerti = "";
                                                 break;
                                         } 
                                         echo $lCerti;
                                    ?>
                                </td>
                                <td>
                                    <?php 
                                        $dStage = '';
                                        switch ($row['dStage']) {
                                             case 'A':
                                                 $dStage = "规划初期";
                                                 break;
                                             case 'B':
                                                 $dStage = "中期";
                                                 break;
                                             case 'C':
                                                 $dStage = "已完成正在审批";
                                                 break;
                                             case 'D':
                                                 $dStage = "其他";
                                                 break;
                                             
                                             default:
                                                 $dStage = " ";
                                                 break;
                                         } 
                                         echo $dStage;
                                    ?>
                                </td>
                                <td>
                                    <?php 
                                        $bLevel = '';
                                        switch ($row['bLevel']) {
                                             case 'A':
                                                 $bLevel = "高";
                                                 break;
                                             case 'B':
                                                 $bLevel = "中";
                                                 break;
                                             case 'C':
                                                 $bLevel = "低";
                                                 break;
                                             default:
                                                 $bLevel = " ";
                                                 break;
                                         } 
                                         echo $bLevel;
                                    ?>
                                </td>
                                <td><?php echo $row['budget'];?></td>
                                <td><?php echo $row['cTime'];?></td>
                                <td align="center"><input type="button" value="删除" class="btn"  onclick="delPrice(<?php echo $row['id'];?>)"></td>
                            </tr>
                            <?php endforeach;?>
                            <?php if($totalRows>$pageSize):?>
                            <tr>
                            	<td colspan="4"><?php echo showPage($page, $totalPage);?></td>
                            </tr>
                            <?php endif;?>
                        </tbody>
                    </table>
                </div>
<script type="text/javascript">
	function editPrice(id){
		window.location="editPrice.php?id="+id;
	}
	function delPrice(id){
		if(window.confirm("您确定要删除吗？")){
			window.location="doAdminAction.php?act=delPrice&id="+id;
		}
	}
</script>
</body>
</html>
